package com.amos.muexamclient.sys.service.dto;


import com.alibaba.fastjson.JSONObject;
import com.amos.core.PageDTO;
import com.amos.muexamclient.sys.entity.SysMenuEntity;
import com.amos.muexamcore.core.MuEntity;
import com.amos.muexamcore.core.MuField;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Copyright © 2018 五月工作室. All rights reserved.
 *
 * @Package com.amos.muexamclient.service.dto
 * @ClassName SysMenuDTO
 * @Description TODO
 * @Author Amos
 * @Modifier
 * @Date 2020-03-24 14:35:22
 * @Version 1.0
 **/
@MuEntity(table = "sys_menu", entity = SysMenuEntity.class)
@Data
public class SysMenuDTO extends PageDTO implements Serializable {

    private static final long serialVersionUID = 3044171744602192600L;
    @MuField(remark = "菜单名称", type = "varchar", length = 50, column = "menu_name")
    private String menuName;

    @MuField(remark = "父菜单ID", type = "varchar", length = 32, column = "parent_id")
    private String parentId;

    @MuField(remark = "显示顺序", type = "int", column = "order_num")
    private String orderNum;

    @MuField(remark = "路由地址", type = "varchar", length = 200, column = "path")
    private String path;

    @MuField(remark = "组件路径", type = "varchar", length = 255, column = "component")
    private String component;

    @MuField(remark = "是否为外链（0是 1否）", type = "int", column = "is_frame")
    private String isFrame;

    @MuField(remark = "菜单类型（M目录 C菜单 F按钮）", type = "char", length = 1, column = "menu_type")
    private String menuType;

    @MuField(remark = "菜单状态（0显示 1隐藏）", type = "tinyint", column = "visible")
    private Boolean visible;

    @MuField(remark = "权限标识", type = "varchar", length = 100, column = "perms")
    private String perms;

    @MuField(remark = "菜单图标", type = "varchar", length = 100, column = "icon")
    private String icon;

    @MuField(remark = "创建者", type = "varchar", length = 64, column = "create_by")
    private String createBy;

    @MuField(remark = "更新者", type = "varchar", length = 64, column = "update_by")
    private String updateBy;

    @MuField(remark = "更新时间", type = "datetime", column = "update_time")
    private Date updateTime;

    @MuField(remark = "备注", type = "varchar", length = 500, column = "remark")
    private String remark;

    private List<SysMenuDTO> children;

    private String userId;

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
